#!/usr/bin/env python3
import sys
from bs4 import BeautifulSoup


soup = BeautifulSoup(open(sys.argv[1]).read(), "lxml")
trss = soup.find_all("tr", attrs={"class":""})
with open("IP2.txt", "a") as d:
    for trsa in trss[1:]:
        ip2 = trsa.find_all("td")[1].string
        port2 = trsa.find_all("td")[2].string
        d.write("%s:%s\n" % (ip2, port2))
        print(ip2, port2)


